/**
 * Created by Baggio on 2018-10-18.
 */
$(function () {
    $("#groupPayExcelIn").click(function () {
        $("#searchForm").ajaxSubmit({
            type: "POST",
            url: '/groupPay/groupPayExcelIn.html',
            data: $('#searchForm').serialize(),
            dataType:"json",
            error: function (request) {

                alert("Connection error");
            },
            beforeSend: function () {
                console.log("begin...............");
                $(".loading").show();
            },
            success: function (data) {
                console.log(data);
                if (data.code != 0) {
                    layer.msg('成功!', {icon: 6, time: 1000}, function () {
                        // console.log(data);
                        // window.parent.location.reload();
                        // var index = parent.layer.getFrameIndex(window.name);
                        // parent.layer.close(index);
                        window.location.reload();//刷新当前页面
                    })
                }
            },
            complete: function (XMLHttpRequest, textStatus) {
                // alert('远程调用成功，状态文本值：'+textStatus);
                console.log("end...............");
                $(".loading").hide();
            },
        });
    }) ;
    $("#groupPayExcelOut").click(function () {
        location.href="/groupPay/groupPayExcelOut.html";
    })
});